home *** CD-ROM | disk | FTP | other *** search
/ The Arsenal Files 8 / The Arsenal Files Collection #8 (Arsenal Computer) (1996).ISO / g_quake / server1.zip / _LEVSEL.QC < prev    next >
Text File  |  1996-09-07  |  5KB  |  120 lines

  1. /*
  2. **
  3. ** _levsel.qc (LevelSelect Code, 1.0)
  4. **
  5. ** Copyright (C) 1996 Johannes Plass
  6. ** 
  7. ** This program is free software; you can redistribute it and/or modify
  8. ** it under the terms of the GNU General Public License as published by
  9. ** the Free Software Foundation; either version 2 of the License, or
  10. ** (at your option) any later version.
  11. ** 
  12. ** This program is distributed in the hope that it will be useful,
  13. ** but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  15. ** GNU General Public License for more details.
  16. **
  17. ** You should have received a copy of the GNU General Public License
  18. ** along with this program; if not, write to the Free Software
  19. ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  20. ** 
  21. ** Author:   Johannes Plass (plass@dipmza.physik.uni-mainz.de)
  22. **
  23. */
  24.  
  25.  
  26. void(entity player) LevelSelectInit =
  27. {
  28.    if (!USE_MODULE_LEVELSELECT) return;
  29.    // nothing to do
  30. };
  31.  
  32. void(entity player) LevelSelectInfo =
  33. {
  34.    if (!USE_MODULE_LEVELSELECT) return;
  35.    // nothing to do
  36. };
  37.  
  38. void() LevelSelectSelectLevel =
  39. {
  40.    if (!USE_MODULE_LEVELSELECT) return;
  41.  
  42.    // 'mapname' is the name of the level which just ended
  43.    // 'nextmap' is the name of the map quake proposes to be the next one
  44.  
  45.  
  46.    // DEATHMATCH LEVELS, END LEVEL
  47.    if      (                     nextmap == "end"  ) nextmap = "dm1"   ;
  48.    else if (mapname == "dm6"                       ) nextmap = "end"   ;
  49.    else if (mapname == "end"                       ) nextmap = "start" ;
  50.  
  51. /*
  52.    // EPISODE 1
  53.    else if (                     nextmap == "e1m1" ) nextmap = "e1m2"  ;
  54.    else if (mapname == "e1m3"                      ) nextmap = "e1m5"  ;
  55.    else if (mapname == "e1m7"                      ) nextmap = "e1m8"  ;
  56.    else if (mapname == "e1m8"                      ) nextmap = "start" ;
  57.  
  58.    // EPISODE 2
  59.    else if (                     nextmap == "e2m1" ) nextmap = "e2m7"  ;
  60.    else if (mapname == "e2m7"                      ) nextmap = "e2m1"  ;
  61.    else if (mapname == "e2m1"                      ) nextmap = "e2m2"  ;
  62.    else if (mapname == "e2m2"                      ) nextmap = "e2m3"  ;
  63.    else if (mapname == "e2m3"                      ) nextmap = "e2m4"  ;
  64.    else if (mapname == "e2m4"                      ) nextmap = "e2m5"  ;
  65.    else if (mapname == "e2m5"                      ) nextmap = "start" ;
  66.  
  67.    // EPISODE 3
  68.    else if (mapname == "e3m1"                      ) nextmap = "e3m5"  ;
  69.    else if (mapname == "e3m5"                      ) nextmap = "e3m6"  ;
  70.    else if (mapname == "e3m6"                      ) nextmap = "e3m7"  ;
  71.    else if (mapname == "e3m7"                      ) nextmap = "start" ;
  72.  
  73.    // EPISODE 4
  74.    else if (mapname == "e4m1"                      ) nextmap = "e4m8"  ;
  75.    else if (mapname == "e4m8"                      ) nextmap = "e4m2"  ;
  76.    else if (mapname == "e4m2"                      ) nextmap = "e4m3"  ;
  77.    else if (mapname == "e4m3"                      ) nextmap = "e4m4"  ;
  78.    else if (mapname == "e4m4"                      ) nextmap = "e4m6"  ;
  79.    else if (mapname == "e4m6"                      ) nextmap = "e4m7"  ;
  80.    else if (mapname == "e4m7"                      ) nextmap = "start" ;
  81. */
  82.  
  83.    return;
  84. };
  85.  
  86. /*
  87. ========================================================================
  88.    EXAMPLE
  89. ========================================================================
  90.  
  91.    if      (                     nextmap == "end"  ) nextmap = "dm1"   ;
  92.    else if (mapname == "dm6"                       ) nextmap = "end"   ;
  93.    else if (mapname == "end"                       ) nextmap = "start" ;
  94.    else if (                     nextmap == "e1m1" ) nextmap = "e1m2"  ;
  95.    else if (mapname == "e1m3"                      ) nextmap = "e1m5"  ;
  96.    else if (mapname == "e1m7"                      ) nextmap = "e1m8"  ;
  97.    else if (mapname == "e1m8"                      ) nextmap = "start" ;
  98.  
  99.    What does the example above ?
  100.  
  101.    Line 1: When Quake wants to play the level "end", we will go to level
  102.            "dm1" instead.
  103.    Line 2: When map "dm6" has ended, Quake usually wants to go to level
  104.            "dm1". But no, we prefer to branch to level "end".
  105.    Line 3: Quake proposes level "e1m1". No, it's ugly, we skip that one
  106.            and go to "e1m2" immediately.
  107.    Line 4: The map "e1m3" just ended. This level has two exits, branching
  108.            to "e1m8" and "e1m4".
  109.            No, we don't like "e1m4" in deathmatch and "e1m8" will be played
  110.            later, so we go to "e1m5" now.
  111.    Line 5: Level "e1m7" just ended and Quake wants to go back to the "start"
  112.            now. We override this and play the secret level "e1m8".
  113.    Line 6: After playing the secret level "e1m8", Quake wants us to play
  114.            "e1m5". However, we already visited this one earlier, so let's
  115.            go the the "start" level.
  116.  
  117. ===========================================================================
  118. */
  119.  
  120.